package com.winning.sx.microframework.plugins.wx;

/**
 * 常量
 */
public class WXPayConstants {

    public enum SignType {
        MD5, HMACSHA256
    }

    public static final String DOMAIN_API = "api.mch.weixin.qq.com";
    public static final String DOMAIN_API2 = "api2.mch.weixin.qq.com";
    public static final String DOMAIN_APIHK = "apihk.mch.weixin.qq.com";
    public static final String DOMAIN_APIUS = "apius.mch.weixin.qq.com";


    public static final String FAIL     = "FAIL";
    public static final String SUCCESS  = "SUCCESS";
    public static final String HMACSHA256 = "HMAC-SHA256";
    public static final String MD5 = "MD5";

    public static final String FIELD_SIGN = "sign";
    public static final String FIELD_SIGN_TYPE = "sign_type";

    public static final String MICROPAY_URL_SUFFIX     = "/pay/micropay";
    public static final String UNIFIEDORDER_URL_SUFFIX = "/pay/unifiedorder";
    public static final String ORDERQUERY_URL_SUFFIX   = "/pay/orderquery";
    public static final String REVERSE_URL_SUFFIX      = "/secapi/pay/reverse";
    public static final String CLOSEORDER_URL_SUFFIX   = "/pay/closeorder";
    public static final String REFUND_URL_SUFFIX       = "/secapi/pay/refund";
    public static final String REFUNDQUERY_URL_SUFFIX  = "/pay/refundquery";
    public static final String DOWNLOADBILL_URL_SUFFIX = "/pay/downloadbill";
    public static final String REPORT_URL_SUFFIX       = "/payitil/report";
    public static final String SHORTURL_URL_SUFFIX     = "/tools/shorturl";
    public static final String AUTHCODETOOPENID_URL_SUFFIX = "/tools/authcodetoopenid";

    // sandbox
    public static final String SANDBOX_MICROPAY_URL_SUFFIX     = "/sandboxnew/pay/micropay";
    public static final String SANDBOX_UNIFIEDORDER_URL_SUFFIX = "/sandboxnew/pay/unifiedorder";
    public static final String SANDBOX_ORDERQUERY_URL_SUFFIX   = "/sandboxnew/pay/orderquery";
    public static final String SANDBOX_REVERSE_URL_SUFFIX      = "/sandboxnew/secapi/pay/reverse";
    public static final String SANDBOX_CLOSEORDER_URL_SUFFIX   = "/sandboxnew/pay/closeorder";
    public static final String SANDBOX_REFUND_URL_SUFFIX       = "/sandboxnew/secapi/pay/refund";
    public static final String SANDBOX_REFUNDQUERY_URL_SUFFIX  = "/sandboxnew/pay/refundquery";
    public static final String SANDBOX_DOWNLOADBILL_URL_SUFFIX = "/sandboxnew/pay/downloadbill";
    public static final String SANDBOX_REPORT_URL_SUFFIX       = "/sandboxnew/payitil/report";
    public static final String SANDBOX_SHORTURL_URL_SUFFIX     = "/sandboxnew/tools/shorturl";
    public static final String SANDBOX_AUTHCODETOOPENID_URL_SUFFIX = "/sandboxnew/tools/authcodetoopenid";

    public static void main(String[] args) {
    	System.out.println(HMACSHA256);
    	//System.out.println(WXPayConstants.SignType.valueOf(HMACSHA256));
    	//System.out.println(Enum.valueOf(HMACSHA256.getClass(), WXPayConstants.SignType.HMACSHA256));
		//System.out.println(String.valueOf(WXPayConstants.SignType.HMACSHA256));
		//System.out.println(WXPayConstants.SignType.HMACSHA256.toString());
		
		String str = "记账时间,微信支付业务单号,资金流水单号,业务名称,业务类型,收支类型,收支金额(元),账户结余(元),资金变更提交申请人,备注,业务凭证号\r\n`2018-07-09 18:22:43,`4200000126201807092617127615,`1509116241180709001009135060393505,`交易,`交易,`收入,`0.01,`0.01,`,`,`201807091822325711571\r\n`2018-07-09 20:56:32,`4200000137201807092268021257,`1509116241180709001009136018558505,`交易,`交易,`收入,`0.01,`0.02,`,`,`201807092056214166791\r\n`2018-07-09 21:10:07,`4200000129201807092710709851,`1509116241180709002009437175895505,`交易,`交易,`收入,`0.01,`0.03,`,`,`201807092109581715181\r\n`2018-07-09 21:59:39,`4200000118201807095392972887,`1509116241180709001009836310796505,`交易,`交易,`收入,`0.01,`0.04,`,`,`201807092159257409816\r\n`2018-07-09 22:22:09,`4200000131201807091821699888,`1509116241180709001009036514662505,`交易,`交易,`收入,`0.01,`0.05,`,`,`201807092222009989545\r\n资金流水总笔数,收入笔数,收入金额,支出笔数,支出金额\r\n`5,`5,`0.05,`0,`0.00\r\n";
		String[] arr = str.split("\r\n");
		for(int i=0;i<arr.length;i++){
			System.out.println(arr[i]);
		}
		System.out.println(arr.length);
	}
}